
Rem
	Performs the ROT13 encoding on the str argument and returns the resulting string.
	
	@author	Nicholas Grant
	@updatedby	
	
	@param	string	str
	
	@variable	string	stringOutput
	@variable	integer	stringLength
	@variable	integer	currentCharValue
	@variable	integer	cnt
	
	@return	string
EndRem
Function str_rot13:String(str:String)
	
	Local stringOutput:String = "";
	Local stringLength:Int = str.Length;
	Local currentCharValue:Int = 0;
	
	If ( stringLength > 0 )
		
		For Local cnt:Int = 0 To ( stringLength - 1 )
			
			currentCharValue = Asc( substr( str, cnt, 1 ) );
			
			If ( currentCharValue > 96 And currentCharValue < 123 )
				stringOutput :+ Chr( ( ( currentCharValue - 84 ) Mod 26 ) + 97 );
			ElseIf ( currentCharValue > 64 And currentCharValue < 91 )
				stringOutput :+ Chr( ( currentCharValue Mod 26 ) + 65 );
			Else
				stringOutput :+ substr( str, cnt, 1 );
			EndIf
			
		Next
		
	EndIf
	
	Return stringOutput;
	
EndFunction
